<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>管理后台</title>
<head th:include="amazeui/include :: header"></head>
<link rel="stylesheet" href="/common/css/pagination.css" />
<body data-type="user">
 <!-- 内容区域 -->
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">用户列表</div>


                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                    <div class="am-form-group tpl-table-list-select">
                                        <select data-am-selected="{btnSize: 'sm'}">
							              <option value="option1">所有类别</option>
							              <option value="option2">IT业界</option>
							              <option value="option3">数码产品</option>
							              <option value="option3">笔记本电脑</option>
							              <option value="option3">平板电脑</option>
							              <option value="option3">只能手机</option>
							              <option value="option3">超极本</option>
							            </select>
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field ">
                                        <span class="am-input-group-btn">
							            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button>
							          </span>
                                    </div>
                                </div>

                                <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black " id="example-r">
                                        <thead>
                                            <tr>
                                                <th>用户名</th>
                                                <th>昵称</th>
                                                <th>注册时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="gradeX" th:each="user : ${list}">
                                                <td th:text="${user.username}">username</td>
                                                <td th:text="${user.nickname}">nickname</td>
                                                <td th:text="${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}">createTime</td>
                                                <td>
                                                    <div class="tpl-table-black-operation">
                                                        <a href="javascript:;">
                                                            <i class="am-icon-pencil"></i> 编辑
                                                        </a>
                                                        <a href="javascript:;" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-trash"></i> 删除
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr>
                                           
                                            <!-- more data -->
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr ">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="am-u-lg-12 am-cf">
                                	 <div class="am-fr ">
                                		<div id="Pagination" class="pagination"><!-- 这里显示分页 --></div>
                                	</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
         
<div th:include="amazeui/include :: footer"></div>
<script src="/amazeui/assets/js/amazeui.datatables.min.js"></script>
<script src="/amazeui/assets/js/dataTables.responsive.min.js"></script>
<script src="/amazeui/assets/js/echarts.min.js"></script>
<script src="/amazeui/assets/js/theme.js"></script>
<script src="/common/js/jquery.pagination.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
    	
    	//这是一个非常简单的demo实例，让列表元素分页显示
    	//回调函数的作用是显示对应分页的列表项内容
    	//回调函数在用户每次点击分页链接的时候执行
    	//参数page_index{int整型}表示当前的索引页
    	var initPagination = function() {
    		var num_entries = 100;
    		// 创建分页
    		$("#Pagination").pagination(num_entries, {
    			prev_text:'前一页',
    			next_text:'下一页',
    			current_page:0,
    			num_edge_entries: 1, //边缘页数
    			num_display_entries: 4, //主体页数
    			callback: pageselectCallback,
    			items_per_page:1 //每页显示1项
    		});
    	 }();
    	 
    	function pageselectCallback(page_index, jq){
	    	console.log(page_index);
    		return false;
    	}
    });

    function login() {
    	
    	var username = $("#username").val();
    	var password = $("#password").val();
    	var data ={username:username,password:password};
        $.ajax({
            type: "POST",
            url: "login",
            data: data,
            success: function (result) {
                if (result.success) {
                    parent.location.href = 'admin/index';
                } else {
                    alert(result.msg);
                }
            }
        });
    }


</script>
</body>

</html>